<template>
  <div class="common-layout">
    <el-container style="min-height: 100vh">
      <el-aside width="200px">
        <el-menu
          default-active="/home/car"
          class="el-menu-vertical-demo"
          @select="handleSelect"
          style="height: 100%"
        >
          <el-menu-item index="/home/car">
            <el-icon><setting /></el-icon>
            <span>汽车</span>
          </el-menu-item>
          <el-menu-item index="/home/train">
            <el-icon><setting /></el-icon>
            <span>火车</span>
          </el-menu-item>
          <el-menu-item index="/home/metal">
            <el-icon><setting /></el-icon>
            <span>金属</span>
          </el-menu-item>
        </el-menu>
      </el-aside>
      <el-main>
        <RouterView />
      </el-main>
    </el-container>
  </div>
</template>

<script lang="ts" setup>
import {
  Document,
  Menu as IconMenu,
  Location,
  Setting,
} from "@element-plus/icons-vue";
import { useRouter } from "vue-router";

const router = useRouter();

const handleSelect = (key: string, keyPath: string[]) => {
  router.push(key);
};
</script>
